home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games: Greatest Hits 1996 / Amiga Games: Greatest Hits 1996.iso / rexx / showfpl.rx < prev    next >
Text File  |  1995-03-08  |  3KB  |  69 lines

  1. /*  ShowFPL.rx                                                                   */
  2. /*
  3. **  By Edd Dumbill © 1995
  4. **
  5. **  Creates an AmigaGuide document to browse FPL programs and their README files
  6. **  and also to install/remove FPL files from the startup directory
  7. **
  8. */
  9. if ~ show('l', "rexxsupport.library") then do
  10.     if ~ addlib('rexxsupport.library', 0, -30, 0) then do
  11.         say 'rexxsupport.library not available - aborting.'
  12.         exit 10
  13.     end
  14. end
  15. PARSE ARG outputfile
  16. if ~ open('opf', outputfile, 'w') then do
  17.     say 'can''t open output file - aborting.'
  18.     exit 20
  19. end
  20. ADDRESS COMMAND
  21.     'list FrexxEd:fpl/#?.FPL LFORMAT %s >t:READMEs'
  22.     'sort FROM t:READMEs TO t:sortedREADMEs'
  23.     'delete t:READMEs quiet'
  24. ADDRESS
  25. if open('flist', 't:sortedREADMEs', 'R') then do
  26.     if open('fout', 't:output', 'W') then do
  27.         writeln('opf', '@database FPLindex')
  28.         writeln('opf', '@remark Created with ShowFPL.rx by and © Edd Dumbill 1995')
  29.         writeln('opf', '@node Main "Index of FPL programs in FrexxEd:FPL/"')
  30.         writeln('opf', 'Click on the filename to view FPL source or on the description')
  31.         writeln('opf', 'to view the README file.')
  32.         writeln('opf', 'Click on @{b}I@{ub} to install the FPL file in the startup directory,')
  33.         writeln('opf', 'and @{b}R@{ub} to remove it from there.')
  34.         writeln('opf', '')
  35.         do while ~ eof('flist')
  36.             fname = readln('flist')
  37.             if open('fplfile', 'FrexxEd:FPL/'||fname||'.README', 'r') then do
  38.                 dummy = ""
  39.                 do while (left(dummy,5) ~= 'Short' & (~ eof('fplfile')))
  40.                     dummy=readln('fplfile')
  41.                 end
  42.                 if (~eof('fplfile')) then do
  43.                     sst = strip(right(dummy, length(dummy)-6),'B');
  44.                     if (left(sst, 12)='description:') then do
  45.                         sst = strip(right(sst, length(sst)-12),'B');
  46.                     end
  47.                     sst = strip(sst,'B',D2C(9));
  48.                     padd=24-length(fname)
  49.                     if padd<1 then padd = 1
  50.                     ibutton=' @{fg fill}@{" I " system "makelink from FrexxEd:startup/'||fname' FrexxEd:FPL/'||fname'"}'
  51.                     rbutton='@{" R " system "delete FrexxEd:startup/'||fname||' QUIET"} '
  52.                     sstlink='@{fg text}@{"' || sst || '" link "FrexxEd:FPL/' || fname || '.README/main"}'
  53.                     writeln('opf',ibutton||rbutton||'@{fg shine}@{"'fname||'" link "FrexxEd:FPL/'||fname||'/main"}'||copies(' ',padd)||sstlink)
  54.                 end
  55.                 close('fplfile')
  56.             end
  57.         end
  58.         close('fout')
  59.         writeln('opf', '@endnode')
  60.     end
  61.     close('flist')
  62. end
  63. address command
  64.     'delete t:sortedREADMEs quiet'
  65.     'copy envarc:sys/def_guide.info 'outputfile||'.info QUIET'
  66. address
  67. close('opf')
  68. exit 0
  69.